OSGWindows Class Reference

#include <OsgWindows.h>

List of all members.

Public Member Functions

 OSGWindows ()
int getCurrentFrameId ()
void setCurrentFrameId (int id)
void setOnDisplayFrameId (int id)
void setClickedFrameId (int id)
osg::ref_ptr< osgProducer::Viewer > getViewer ()
void loadFrame (int clickedFrameId)
void clearFrames (void)
void addObject (TraffEduObject *obj)
vector< TraffEduObject * > getObjects (void)
vector< Frame * > & getFrames (void)
void doDeleteGeode (TraffEduObject *obj)
void doAddGeode (TraffEduObject *obj)
osg::ref_ptr< osg::Group > getConstantRoot ()
osg::ref_ptr< osg::Group > getTextRoot ()
int sizeOfFrames ()
Frame * getCurrentFrame ()
void sortFrames ()
int returnIndex (int id)
vector< textperFrame * > & getTextArray ()
void clickedOnAFrame (int frameId)
void changeCurrentFrame (int frameId, int oldonDisplayFrameId)
void displayAFrame (int frameId)
void addNewFrame ()
void deleteFrame ()
int findReferenceFrame (int id)
bool canAddNewFrame ()
bool canDeleteAFrame ()
int getOnDisplayFrameId ()
void addCommandDelete ()
void addCommandDelete (TraffEduObject *obj)
void addCommandCut ()
void addCommandCut (TraffEduObject *obj)
void addCommandCopy (void)
void addCommandCopy (TraffEduObject *obj)
void addCommandPaste (osg::Vec3 pos)
void addCommandSelect (int isMultipleSelection, TraffEduObject *obj)
void addCommandSelectAll ()
void addCommandDeselectAll ()
void addCommandDeselect (TraffEduObject *obj)
void addCommandInsertTrafficLight (osg::Vec3 pos, TrafficLightTypes newType=NORMAL_ISIK, TrafficLightColor newColor=YESIL, TrafficLightColor newArrowColor=YESIL)
void addCommandInsertTrafficSign (osg::Vec3 pos, TrafficSignTypes newType=DIKKAT)
void addCommandInsertVehicle (osg::Vec3 pos, string pathname, float scale)
void addCommandInsertEnvObj (osg::Vec3 pos, string pathname, float scale)
void addCommandRotate (float angle)
void addCommandRotate (float angle, TraffEduObject *obj)
void addCommandTranslate (TraffEduObject *obj, osg::Vec3 old_position, osg::Vec3 new_position)
void dropUnselectedObject (TraffEduObject *obj)
bool canUndo ()
bool canRedo ()
void undo ()
void redo ()
BOOL isModified ()
void setSelectedObjects (TraffEduObject *obj)
vector< TraffEduObject * > getSelectedObjects (void)
void setCutObjects (void)
void setCutObjects (TraffEduObject *obj)
vector< TraffEduObject * > getCutObjects (void)
vector< TraffEduObject * > getCopiedObjects (void)
void clearSelectedObjects (void)
void clearCopiedObjects (void)
void clearCutObjects (void)
void setCopiedObjects (void)
void setCopiedObjects (TraffEduObject *obj)
void fillSelectedObjects (void)
void clearObjects (void)
bool getAudioFlag ()

Public Attributes

bool m_b_AudioInserted

Private Attributes

vector< Frame * > frames
vector< TraffEduObject * > objects
vector< textperFrame * > textArray
int currentFrameNum
Frame * currentFrame
osg::ref_ptr< osgProducer::Viewer > viewer
osg::ref_ptr< osg::Group > mainRoot
osg::ref_ptr< osg::Group > textRoot
int clickedFrameId
int onDisplayFrameId
GUICommandManager * eventHandler
vector< TraffEduObject * > selectedObjects
vector< TraffEduObject * > copiedObjects
vector< TraffEduObject * > cutObjects


Detailed Description

A OsgWindows class.This class is used for holding information about the keyframes and performing operations for constructing traffic cases.


Constructor & Destructor Documentation

OSGWindows::OSGWindows (   ) 
 

A constructor. Initializes the all the private variables.


Member Function Documentation

void OSGWindows::addCommandCopy (  TraffEduObject *  obj  ) 
 

creates a CommandCopy object and awakes the GUICommandManager about this operation.

Parameters:
obj a TraffEduObject pointer.

void OSGWindows::addCommandCopy (  void   ) 
 

creates a CommandCopy object and awakes the GUICommandManager about this operation.

void OSGWindows::addCommandCut (  TraffEduObject *  obj  ) 
 

creates a CommandCut object and awakes the GUICommandManager about this operation.

Parameters:
obj a TraffEduObject pointer.

void OSGWindows::addCommandCut (   ) 
 

creates a CommandCut object and awakes the GUICommandManager about this operation.

void OSGWindows::addCommandDelete (  TraffEduObject *  obj  ) 
 

creates a CommandDelete object and awakes the GUICommandManager about this operation.

Parameters:
obj a TraffEduObject pointer.

void OSGWindows::addCommandDelete (   ) 
 

creates a CommandDelete object and awakes the GUICommandManager about this operation.

void OSGWindows::addCommandDeselect (  TraffEduObject *  obj  ) 
 

creates a CommandDeselect object and awakes the GUICommandManager about this operation.

Parameters:
obj a TraffEduObject pointer.

void OSGWindows::addCommandDeselectAll (   ) 
 

creates a CommandDeselectAll object and awakes the GUICommandManager about this operation.

void OSGWindows::addCommandInsertEnvObj (  osg::Vec3  pos,
string  pathname,
float  scale
) 
 

creates a CommandInsertEnvObj object and awakes the GUICommandManager about this operation.

Parameters:
pos a osg::Vec3 argument.
pathname a string argument.
scale a float argument.

void OSGWindows::addCommandInsertTrafficLight (  osg::Vec3  pos,
TrafficLightTypes  newType = NORMAL_ISIK,
TrafficLightColor  newColor = YESIL,
TrafficLightColor  newArrowColor = YESIL
) 
 

creates a CommandInsertTrafficLight object and awakes the GUICommandManager about this operation.

Parameters:
pos a osg::Vec3 argument.
newType a TrafficLightTypes argument
newColor a TrafficLightColor argument
newArrowColor a TrafficLightColor argument

void OSGWindows::addCommandInsertTrafficSign (  osg::Vec3  pos,
TrafficSignTypes  newType = DIKKAT
) 
 

creates a CommandInsertTrafficSign object and awakes the GUICommandManager about this operation.

Parameters:
pos a osg::Vec3 argument.
newType a TrafficSignTypes argument.

void OSGWindows::addCommandInsertVehicle (  osg::Vec3  pos,
string  pathname,
float  scale
) 
 

creates a CommandInsertVehicle object and awakes the GUICommandManager about this operation.

Parameters:
pos a osg::Vec3 argument.
pathname a string argument.
scale a float argument.

void OSGWindows::addCommandPaste (  osg::Vec3  pos  ) 
 

creates a CommandPaste object and awakes the GUICommandManager about this operation.

void OSGWindows::addCommandRotate (  float  angle,
TraffEduObject *  obj
) 
 

creates a CommandRotate object and awakes the GUICommandManager about this operation.

Parameters:
angle a float argument.
obj a TraffEduObject pointer.

void OSGWindows::addCommandRotate (  float  angle  ) 
 

creates a CommandRotate object and awakes the GUICommandManager about this operation.

Parameters:
angle a float argument.

void OSGWindows::addCommandSelect (  int  isMultipleSelection,
TraffEduObject *  obj
) 
 

creates a CommandSelect object and awakes the GUICommandManager about this operation.

Parameters:
isMultipleSelection an integer argument.
obj a TraffEduObject pointer.

void OSGWindows::addCommandSelectAll (   ) 
 

creates a CommandSelectAll object and awakes the GUICommandManager about this operation.

void OSGWindows::addCommandTranslate (  TraffEduObject *  obj,
osg::Vec3  old_position,
osg::Vec3  new_position
) 
 

creates a CommandTranslate object and awakes the GUICommandManager about this operation.

Parameters:
obj a TraffEduObject pointer.
old_position a osg::Vec3 argument.
new_position a osg::Vec3 argument.

void OSGWindows::addNewFrame (   ) 
 

creates a new key frame and pushes it to the frames vector when the user inserts a new frame from the menubar.

void OSGWindows::addObject (  TraffEduObject *  obj  ) 
 

adds a new object to the objects vector.

Parameters:
obj a TraffEduObject pointer.

bool OSGWindows::canAddNewFrame (   ) 
 

shows if it is possible to add a new key frame to the environment.

Returns:
The test result

bool OSGWindows::canDeleteAFrame (   ) 
 

shows if it is possible to delete a key frame from the environment.

Returns:
The test result

bool OSGWindows::canRedo (   ) 
 

a member method showing if redo operation can be performed.

Returns:
Test result

bool OSGWindows::canUndo (   ) 
 

a member method showing if undo operation can be performed.

Returns:
Test result

void OSGWindows::changeCurrentFrame (  int  frameId,
int  oldonDisplayFrameId
) 
 

changes current frame, make its root draw, and make the environment editable.

Parameters:
frameId an integer argument.
oldonDisplayFrameId an integer argument.

void OSGWindows::clearCopiedObjects (  void   ) 
 

clears the copied objects vector.

void OSGWindows::clearCutObjects (  void   ) 
 

clears the cut objects vector.

void OSGWindows::clearFrames (  void   ) 
 

clears all the keyframes from the environment.

void OSGWindows::clearObjects (  void   ) 
 

clears the objects vector.

void OSGWindows::clearSelectedObjects (  void   ) 
 

clears the selected objects vector.

void OSGWindows::clickedOnAFrame (  int  frameId  ) 
 

decides which keyframe root should be drawn to the scene and make it draw.

Parameters:
frameId an integer argument.

void OSGWindows::deleteFrame (   ) 
 

removes the current frame from the frames vector when the user deletes a frame from the menubar.

void OSGWindows::displayAFrame (  int  frameId  ) 
 

makes root of any frame,which is not current frame draw, and make the environment non_editable.

Parameters:
frameId an integer argument.

void OSGWindows::doAddGeode (  TraffEduObject *  obj  ) 
 

adds the geode of the given object to the scene root.

Parameters:
obj a TraffEduObject pointer.

void OSGWindows::doDeleteGeode (  TraffEduObject *  obj  ) 
 

deletes the geode of the given object from the scene root.

Parameters:
obj a TraffEduObject pointer.

void OSGWindows::dropUnselectedObject (  TraffEduObject *  obj  ) 
 

removes the given object from the selected objects vector.

Parameters:
obj a TraffEduObject pointer.

void OSGWindows::fillSelectedObjects (  void   ) 
 

copies all the active objects in the objects vector to the selected objects vector.

int OSGWindows::findReferenceFrame (  int  id  ) 
 

finds the frameId of the keyframe that is nearest to the frame that has frameId equals to the id.

Parameters:
id an integer argument.
Returns:
The frameId of the keyframe that is nearest to the frame that has frameId equals to the id

bool OSGWindows::getAudioFlag (   ) 
 

shows if background music is inserted.

Returns:
Test result

osg::ref_ptr<osg::Group> OSGWindows::getConstantRoot (   ) 
 

returns the main scene root of the environment.

Returns:
mainRoot

vector<TraffEduObject*> OSGWindows::getCopiedObjects (  void   ) 
 

returns the copied objects vector.

Returns:
copiedObjects vector

Frame* OSGWindows::getCurrentFrame (   ) 
 

returns the current frame.

Returns:
Pointer to the current frame

int OSGWindows::getCurrentFrameId (   ) 
 

returns the current frame id.

Returns:
ID of the current frame

vector<TraffEduObject*> OSGWindows::getCutObjects (  void   ) 
 

returns the cut objects vector.

Returns:
cutObjects vector

vector<Frame*>& OSGWindows::getFrames (  void   ) 
 

returns the frames vector in the environment.

Returns:
frames vector

vector<TraffEduObject*> OSGWindows::getObjects (  void   ) 
 

returns the object vector in the environment.

Returns:
object vector

int OSGWindows::getOnDisplayFrameId (   ) 
 

returns the on display frame id.

Returns:
onDisplayFrameId

vector<TraffEduObject*> OSGWindows::getSelectedObjects (  void   ) 
 

returns the selected objects vector.

Returns:
selectedObjects vector

vector<textperFrame* >& OSGWindows::getTextArray (   ) 
 

returns the textArray vector in the environment.

Returns:
textArray vector

osg::ref_ptr<osg::Group> OSGWindows::getTextRoot (   ) 
 

returns the text root of the environment.

Returns:
textRoot

osg::ref_ptr<osgProducer::Viewer> OSGWindows::getViewer (   )  [inline]
 

returns reference to the scene viewer.

Returns:
Reference to the viewer

BOOL OSGWindows::isModified (   ) 
 

a member method showing if GUICommandManager is awaken before.

Returns:
Test result

void OSGWindows::loadFrame (  int  clickedFrameId  ) 
 

loads a new frame to the environment.

Parameters:
clickedFrameId an integer argument.

void OSGWindows::redo (   ) 
 

calls the Redo method of the GUICommandManager.

int OSGWindows::returnIndex (  int  id  ) 
 

returns index of the frame that has frameId equal to the id.

Parameters:
id an integer argument.
Returns:
The index of the frame that has frameId equal to the id

void OSGWindows::setClickedFrameId (  int  id  ) 
 

sets clicked frame id.

Parameters:
id an integer argument.

void OSGWindows::setCopiedObjects (  TraffEduObject *  obj  ) 
 

add a new object to the copied objects vector.

Parameters:
obj a TraffEduObject pointer.

void OSGWindows::setCopiedObjects (  void   ) 
 

copies all the objects in the selected objects vector to the cut objects vector.

void OSGWindows::setCurrentFrameId (  int  id  ) 
 

sets current frame id.

Parameters:
id an integer argument.

void OSGWindows::setCutObjects (  TraffEduObject *  obj  ) 
 

add a new object to the cut objects vector.

Parameters:
obj a TraffEduObject pointer.

void OSGWindows::setCutObjects (  void   ) 
 

moves all the objects in the selected objects vector to the cut objects vector.

void OSGWindows::setOnDisplayFrameId (  int  id  ) 
 

sets on display frame id.

Parameters:
id an integer argument.

void OSGWindows::setSelectedObjects (  TraffEduObject *  obj  ) 
 

add a new object to the selected objects vector.

Parameters:
obj a TraffEduObject pointer.

int OSGWindows::sizeOfFrames (   ) 
 

returns size of the frames vector.

Returns:
Size of the frames vector

void OSGWindows::sortFrames (   ) 
 

sorts the keyframes in the frames vector according to their frameId.

void OSGWindows::undo (   ) 
 

calls the Undo method of the GUICommandManager.


Member Data Documentation

int OSGWindows::clickedFrameId [private]
 

a private variable. It holds id of the frame that is clicked from the timeline.

vector<TraffEduObject*> OSGWindows::copiedObjects [private]
 

a private vector of TraffEduObjects. It holds the copied objects in the environment

Frame* OSGWindows::currentFrame [private]
 

a private variable. It holds pointer to the current frame.

int OSGWindows::currentFrameNum [private]
 

a private variable. It holds the current frame id.

vector<TraffEduObject*> OSGWindows::cutObjects [private]
 

a private vector of TraffEduObjects. It holds the cut objects in the environment

GUICommandManager* OSGWindows::eventHandler [private]
 

a private variable. It holds pointer to the event handler of the GUI.

vector<Frame*> OSGWindows::frames [private]
 

a private vector of Frames. It holds key frames.

bool OSGWindows::m_b_AudioInserted
 

a private variable. It shows if background music is inserted into the environment or not.

osg::ref_ptr<osg::Group> OSGWindows::mainRoot [private]
 

a private variable. It holds pointer to the main root of the scene.

vector<TraffEduObject*> OSGWindows::objects [private]
 

a private vector of TraffEduObjects. It holds objects in the environment.

int OSGWindows::onDisplayFrameId [private]
 

a private variable. It holds id of the frame that is currently displayed.

vector<TraffEduObject*> OSGWindows::selectedObjects [private]
 

a private vector of TraffEduObjects. It holds the selected objects in the environment

vector< textperFrame *> OSGWindows::textArray [private]
 

a private vector of textperFrame. It holds information about texts inserted into the environment.

osg::ref_ptr<osg::Group> OSGWindows::textRoot [private]
 

a private variable. It holds pointer to the root that holds text information.

osg::ref_ptr<osgProducer::Viewer> OSGWindows::viewer [private]
 

a private variable. It holds pointer to the viewer of the scene.


The documentation for this class was generated from the following file:
Generated on Sun May 28 18:44:00 2006 by  doxygen 1.4.6-NO